﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SoundSynth.Oscillators
{
    public class TriangleOscillator:BaseOscillator
    {
        public TriangleOscillator():base(){}
        public override float GetNext(float timedomain)
        {
            return 1f - 4f * (float)Math.Abs
                        (Math.Round(timedomain - 0.25f) - (timedomain - 0.25f));
        }
    }
}
